#!/bin/bash
source /etc/profile

# 服务启动脚本添加执行权限
chmod +x /data/apps/run-service.sh
chmod +x /usr/local/all-agent-start.sh

# 启动容器基础agent，这个必须在进程监控脚本之前执行
/usr/local/all-agent-start.sh > /dev/null 2>&1


# 启动zhiyan-log-agent
cd /usr/local/zhiyan-log-agent && ./install.sh --ip  "[${CLUSTER_ID}]-[${POD_NAMESPACE}]-[${POD_NAME}]" > /dev/null 2>&1

mkdir -p /data/apps/logs/

# 启动进程
/data/apps/run-service.sh start > /dev/null 2>&1

# 启动进程监控脚本无对外端口方式
notifyUsers="delanhuang;p_henryxliu;p_htaozhou;p_louisbliu"
/usr/local/TKEstack_scripts/check_process_v2.sh "/data/apps/run-service.sh start > /dev/null 2>&1" "${notifyUsers}" "data/apps/app.jar" "8080" "root"

tail -10f /usr/local/all-agent-start.sh